Conversation
Co-Authored-By: jbailey@launchdarkly.com <accounts@sidewaysgravity.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| @@ -203,6 +224,11 @@ def config(config_key, context, default_value = nil, variables = nil) | |||
| provider: provider_config | |||
| ) | |||
| end | |||
There was a problem hiding this comment.
There should be a break between methods here.
There was a problem hiding this comment.
Added a blank line between the methods.
lib/server/ai/client.rb
Outdated
| TRACK_SDK_INFO, | ||
| INIT_TRACK_CONTEXT, | ||
| { | ||
| aiSdkName: 'launchdarkly-server-sdk-ai', |
There was a problem hiding this comment.
In other sdk's we kept this information in an sdk info / meta type file so it could be used in other places if needed.
There was a problem hiding this comment.
Extracted SDK info into a dedicated lib/server/ai/sdk_info.rb module with SDK_NAME and SDK_LANGUAGE constants (similar to sdkInfo.ts in JS and sdk_info.py in Python). The client now references those constants instead of hardcoded strings.
Co-Authored-By: jbailey@launchdarkly.com <accounts@sidewaysgravity.com>
Co-Authored-By: jbailey@launchdarkly.com <accounts@sidewaysgravity.com>
Requirements
Related issues
Describe the solution you've provided
Aligns the Ruby AI SDK's usage tracking with the updated spec from sdk-specs PRs #132 and #134. Three categories of changes:
Renamed usage tracking event key from
$ld:ai:config:function:singleto$ld:ai:usage:completion-config, matching the new unified$ld:ai:usage:*namespace. (This SDK only has the single completion config method — no judge, agent, or createChat methods — so only one key needed updating.)Added SDK info tracking on initialization (
$ld:ai:sdk-info). WhenClientis constructed, it fires a single tracking event with SDK name, version, and language using an anonymous context with kindld-aiand keyld-internal-tracking. SDK identity constants are kept in a dedicatedsdk_info.rbmodule (similar tosdkInfo.tsin JS andsdk_info.pyin Python).Renamed
configtocompletion_configto align with the updated spec method naming. The oldconfigmethod is preserved as a deprecated proxy that emits a warning and delegates tocompletion_config.Human review checklist
$ld:ai:usage:completion-configexactly matches the specld-aiwith keyld-internal-trackingper sdk-specs PR #134INIT_TRACK_CONTEXTbeing created at module load time (outsideclass Client) is acceptable — it callsLDContext.createwhen the module is first loadedconfig(emittingwarnon every call) is acceptable for existing consumersAdditional context